<template>
  <a-spin :spinning="confirmLoading">
    <j-form-container :disabled="formDisabled">
      <!-- 主表单区域 -->
      <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
        <a-row>
          <a-col :span="8" >
            <a-form-model-item label="开始时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="startTime">
              <a-date-picker
                mode="year"
                v-model="model.startTime"
                :open="startDateOpen"
                format="YYYY"
                :allowClear="false"
                :disabled-date="disabledStartDate"
                @openChange="openChangeStartDate"
                @panelChange="panelStartChange"
              />
            </a-form-model-item>
          </a-col>
          <a-col :span="8" >
            <a-form-model-item label="结束时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="endTime">
              <a-date-picker
                mode="year"
                v-model="model.endTime"
                :open="endDateOpen"
                :disabled-date="disabledEndDate"
                format="YYYY"
                :allowClear="false"
                @openChange="openChangeEndDate"
                @panelChange="panelEndChange"
              />
            </a-form-model-item>
          </a-col>
          <a-col :span="8" >
            <a-form-model-item label="级别" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="classess">
              <j-dict-select-tag type="list" v-model="model.classess" dictCode="ZXJPK_CLASSESS" placeholder="请选择级别" />
            </a-form-model-item>
          </a-col>
          <a-col :span="24" >
            <a-form-model-item label="课程名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="className">
              <a-input v-model="model.className" placeholder="请输入课程名称" ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24" >
            <a-form-model-item label="备注" :labelCol="{ span: 2 }" :wrapperCol="{ span: 22 }" prop="remark">
              <a-input v-model="model.remark" placeholder="请输入备注"/>
            </a-form-model-item>
          </a-col>
        </a-row>
      </a-form-model>
    </j-form-container>
      <!-- 子表单区域 -->
    <member-list ref="memberListRef" v-model="memberListTable.dataSource" :disabled="formDisabled" :loading="memberListTable.loading"></member-list>
  </a-spin>
</template>

<script>

  import { getAction } from '@/api/manage'
  import MemberList from '@views/gfxy/common/memberList'
  import { GfxyMemberListMixin } from '@/mixins/GfxyMemberListMixin'
  import { FormTypes,getRefPromise,VALIDATE_NO_PASSED } from '@/utils/JEditableTableUtil'
  import { GfxyYearRangePickerMixin } from '@/mixins/GfxyYearRangePickerMixin'
  import { JEditableTableModelMixin } from '@/mixins/JEditableTableModelMixin'
  import { validateDuplicateValue } from '@/utils/util'

  export default {
    name: 'GfxyTZxjpkForm',
    mixins: [
      GfxyYearRangePickerMixin,
      GfxyMemberListMixin
    ],
    components: {
      MemberList
    },
    data() {
      return {
        labelCol: {
          xs: { span: 24 },
          sm: { span: 6 },
        },
        wrapperCol: {
          xs: { span: 24 },
          sm: { span: 16 },
        },
        labelCol2: {
          xs: { span: 24 },
          sm: { span: 3 },
        },
        wrapperCol2: {
          xs: { span: 24 },
          sm: { span: 20 },
        },

        validatorRules: {
           startTime: [
              { required: true, message: '请输入开始时间!'},
           ],
           endTime: [
              { required: true, message: '请输入结束时间!'},
           ],
           classess: [
              { required: true, message: '请输入级别!'},
           ],
           className: [
              { required: true, message: '请输入课程名称!'},
           ],
        },

        url: {
          add: "/jin/gfxyTZxjpk/add",
          edit: "/jin/gfxyTZxjpk/edit",
          queryById: "/jin/gfxyTZxjpk/queryById",
          memberList: {
            list: '/jin/gfxyTZxjpk/queryMemberListByMainId'
          },
        }
      }
    },
    props: {
      //表单禁用
      disabled: {
        type: Boolean,
        default: false,
        required: false
      },
      projectType:{
        type: Number,
        required: true,
      },
      date:{
        type: String,
        required: true,
      }
    },
    computed: {
      formDisabled(){
        return this.disabled
      },
    },
    created () {
    },
    methods: {

    }
  }
</script>

<style scoped>
</style>